perm filename PROB4.PUB[LSP,JRA]10 blob sn#254377 filedate 1976-12-26 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	.CENT(Problems involving list-notation)
C00004 ENDMK
C⊗;
.CENT(Problems involving list-notation)

I Discuss %3cons[%9α%41%3;cons[%9α%42%3;%9α%43%3]]%1 
as opposed to %3cons[%9α%41%3;cons[%9α%42%3; cons[%9α%43%3; NIL]]]%1 
as a representation for %3(%9α%41%3, %9α%42%3, %9α%43%3)%1.
.P12:
.BEGIN CENTERIT;SELECT 1;
.GROUP
.P65:
II  Translate the following lists into S-expr dotted-pair notation.
←%21.%3 (A B C)   %22.%3 (A)   %23.%3 ((A))   %24.%3 (A (B (C)))  %25.%3 (NIL).
.APART
.GROUP
%1

Now go the other way and translate the following S-exprs into list notation.
←%26.%3 ((A . (B . NIL)) . ((C . NIL) . NIL))   %27.%3 (NIL . NIL)
←%28.%3 (CONS . ((QUOTE . (A . NIL)) . NIL))
.APART
.GROUP
%1

III  Evaluate the following:
←%21.%3 first[(A B)]   %22.%3 rest[(A B)]   
←%23.%3 concat[A;(B C)]   %24.%3 concat[A;NIL]
←%25.%3 concat[eq[A;A];(A B C)] %26.%3 first[rest[(A B)]]
.APART
.END